function imgcks(path){
		layer.open({
		  type: 1,
		  title: false,
		  closeBtn: 0,
		  area: '1000px',
		  skin: 'layui-layer-nobg', //没有背景色
		  shadeClose: true,
		  content: "<img src="+path+" style='width:100%;'><br/><a style='float:right;border: 1px solid red;padding: 10px 20px;background-color: red;color:#fff;margin-left:50px' data="+path+" Onclick='delimgs(this)'>删除</a><a style='float:right;border: 1px solid green;padding: 10px 20px;background-color: green;color:#fff' data="+path+" Onclick='tiaozhuan(this)'>旋转</a>"
		  //content: '<img src='+path+' style="width:100%"><br/><a style="float:right;" onclick="tiaozhuan('+path+')">旋转</a>'
		});
	}
function imgck(path,id){
		layer.open({
		  type: 1,
		  title: false,
		  closeBtn: 0,
		  area: '1000px',
		  skin: 'layui-layer-nobg', //没有背景色
		  shadeClose: true,
		  content: "<img src="+path+" style='width:100%;'><br/><a style='float:right;border: 1px solid red;padding: 10px 20px;background-color: red;color:#fff;margin-left:50px' data="+path+" Onclick='delimg("+id+")'>删除</a><a style='float:right;border: 1px solid green;padding: 10px 20px;background-color: green;color:#fff' data="+path+" Onclick='tiaozhuan(this)'>旋转</a>"
		  //content: '<img src='+path+' style="width:100%"><br/><a style="float:right;" onclick="tiaozhuan('+path+')">旋转</a>'
		});
	}
function tiaozhuan(obj){
	var path=$(obj).attr("data");
	$.post("/admin.php/user/imgturn",{path:path},function(data){
		if(data.code == 0){
			location.reload();
		}else{
			alert("操作失败");
		}
	},'json')
	//window.location.href="/admin.php/user/imgturn?path="+path;
}
function delimg(id){
	if($.trim(id) == ''){
		alert("无法删除");
		return false;
	}
	if(confirm('是否确认删除该头像？')){
		$.post("/admin.php/user/delUserImg",{id:id},function(data){
			if(data.code == 0){
				location.reload();
			}else{
				alert("操作失败");
			}
		},'json')
	}

	//window.location.href="/admin.php/user/imgturn?path="+path;
}
function delimgs(obj){
	if(confirm('是否确认删除该头像？')){
	var path=$(obj).attr("data");
	$.post("/admin.php/user/delImg",{path:path},function(data){
		if(data.code == 0){
			location.reload();
		}else{
			alert("操作失败");
		}
	},'json')
	}
	//window.location.href="/admin.php/user/imgturn?path="+path;
}